<template>
  <div class="son">
    <h4>name: {{ name }}</h4>
    <h4>age: {{ age }}</h4>
    <button @click="isShowInfo">显示信息</button>
    <button @click="changeAge">修改年龄</button>
  </div>
</template>

<script>
export default {
  name: 'son',
  props: {
    name: {
      type: String,
      default: '夜殇'
    },
    age: {
      type: Number,
      default: 18
    },
    changeAge: {
      type: Function
    }
  },
  methods: {
    isShowInfo() {
      this.$emit('show')
    }
  }
}
</script>
